/**
 * 处理回显会员管理所在地区的级联结构参数
 * @param {} cascaderList 树形结构数据
 * @param {} locationProvince 省
 * @param {} locationCity 市
 * @param {} locationArea 区
 */
export function handleAddrCascader(cascaderList, { locationProvince, locationCity, locationArea }) {
  const addrObj = {};
  cascaderList.some((provinceItem) => {
    if (provinceItem.name === locationProvince) {
      addrObj.locationProvinceId = provinceItem.id;
      return provinceItem.chirdList.some((cityItem) => {
        if (cityItem.name === locationCity) {
          addrObj.locationCityId = cityItem.id;
          cityItem.chirdList.some((item) => {
            if (item.name === locationArea) {
              addrObj.locationAreaId = item.id;
              return true;
            }
          });
        }
      });
    }
  });
  return addrObj;
}
